package com.bsj.power.common.def.entity.path;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bsj.power.common.util.DateUtils;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.sql.Time;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description Path
 * @time 2024/4/20 10:52
 */
@Data
@TableName(value = "tab_path")
public class Path {

    /**
     * 围栏id
     */
    @TableId(value = "path_id", type = IdType.AUTO)
    private Integer pathId;

    /**
     * 围栏名称
     */
    @TableField("path_name")
    private String pathName;

    /**
     * 围栏地址
     */
    @TableField("path_address")
    private String pathAddress;

    /**
     * 围栏类型 1关键敏感区域 2防异物区域 3受限空间区域 4风险区域
     */
    @TableField("path_type")
    private Integer pathType;

    /**
     * 状态 1进围栏 2出围栏
     */
    @TableField("status")
    private Integer status;

    /**
     * 开始时间
     */
    @TableField("begin_time")
    private Time beginTime;

    /**
     * 结束时间
     */
    @TableField("end_time")
    private Time endTime;

    /**
     * 颜色
     */
    @TableField("color")
    private String color;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    /**
     * 位置点信息
     */
    @TableField(exist = false)
    private List<PathPoint> pathPoints;

    /**
     * 楼层（几米层）-9.5m1;0m2;7.5m3;16m4;23m5
     */
    @TableField("floor")
    private Integer floor;

    /**
     * 机组号
     */
    @TableField("building")
    private Integer building;

    /**
     * 是否是室外   1是  2否
     */
    @TableField("is_outdoor")
    private Integer isOutdoor;

    /**
     * mapId（前端判断楼层栋数）
     */
    @TableField("map_id")
    private Integer mapId;

    /**
     * 房间号
     */
    @TableField("room_no")
    private String roomNo;

    /**
     * 是否禁用标识 0:启用  1:禁用
     */
    @TableField("is_ban")
    private Integer isBan;

    public static void main(String[] args) throws ParseException {
        Time time1 = Time.valueOf("19:34:12");
        Time time2 = Time.valueOf("19:35:30");
        System.out.println(time1);
        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
        Time time = new Time(System.currentTimeMillis());
        String format = sdf.format(time);
        System.out.println(format);

        Time time3 = Time.valueOf(format);
        int comparison = time3.compareTo(time1);
        int compareTo = time3.compareTo(time2);
        System.out.println(comparison);
        System.out.println(compareTo);
        System.out.println(time3.compareTo(time1) >= 0 && time3.compareTo(time2) < 0);
    }

}
